package com.fz.controller;

import com.fz.dao.BookDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by webrx on 2017-09-11.
 */
@Controller
public class BookController {
    @Autowired
    protected BookDAO bdao;
    @RequestMapping("/show") @ResponseBody
    public void show(){
        System.out.println(bdao.queryById(6));
    }


    @RequestMapping("/shows")
    public String shows(Model model){
        model.addAttribute("book",bdao.queryById(6));
        return "show";
    }
}
